Skip to content

Refactor process execution#44

Merged
cameroncooke merged 4 commits intomainfrom
refactor_process_execution
May 15, 2025
Merged

Refactor process execution#44
cameroncooke merged 4 commits intomainfrom
refactor_process_execution

Conversation

@cameroncooke
Copy link
Collaborator

Refactor process execution functions to use a single unified executeCommand function, this can be used directly for basic shell commands. For xcodebuild ... build|test etc commands executeXcodeBuildCommand should be preferred which calls the lower level executeCommand to spaw then xcodebuild process.

@cameroncooke cameroncooke requested review from Copilot and peymankh4 May 14, 2025 21:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors process execution by unifying command execution under a single executeCommand function, and updates various utility and tool modules to call this function consistently.

  • Refactored execution functions in xcodemake, build-utils, and other tools to use a unified executeCommand
  • Removed deprecated executeXcodeCommand and related types in favor of executeCommand
  • Updated workflow documentation to reflect naming changes

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/utils/xcodemake.ts Replaced custom command execution with executeCommand and simplified argument escaping
src/utils/xcode.ts Removed redundant executeXcodeCommand function
src/utils/command.ts Updated executeCommand to support array commands and shell option
src/utils/build-utils.ts Renamed function to executeXcodeBuildCommand and shifted to executeCommand
src/types/common.ts Removed XcodeCommandResponse type
src/tools/*.ts Updated various tools (simulator, idb, clean, build, etc.) to use executeCommand
.windsurf/workflows/build-app.md Updated descriptions for clarity
Comments suppressed due to low confidence (2)

src/utils/xcodemake.ts:208

  • Avoid using process.chdir in a utility function as it changes the global working directory. Instead, update executeCommand to accept a cwd option and pass projectDir to spawn so that the working directory is set locally for that command execution.
process.chdir(projectDir);

src/utils/command.ts:65

  • [nitpick] Consider enhancing error reporting in the 'error' event handler to wrap the raw error with additional context (e.g., including the executed command) for improved debugging in production.
const process = spawn(executable, args, { stdio: ['ignore', 'pipe', 'pipe'] });

@cameroncooke cameroncooke merged commit 32bc9ca into main May 15, 2025
1 check passed
@cameroncooke cameroncooke deleted the refactor_process_execution branch May 15, 2025 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants